<?php
if ( !defined( "IN_OP" ) )
{
    exit( "You can't access this file directly..." );
}
if ( ( $curruser['acl'] < 255 || $curruser['acl'] == 255 && $curruser['prev_id'] != 0 ) && !SubAccountRight( $curruser, 1 ) )
{
    diemsg( "你不是管理者！" );
}
$conf = new Config();
$ui = new UI();
$tpl = new Template2();
$rs = getdb( "select id,round,open from lotto where open>='".date( "Y-m-d" )."' order by open" );
if ( $rs->eof )
{
    $ui->showErrorPage( "<p>目前没有期数！</p>" );
    exit();
}
$lotto_id = $rs->f['id'];
$round = $rs->f['round'];
$open = $rs->f['open'];
$rs->close();
$tpl->set( "lotto_id", $lotto_id );
$tpl->set( "round", d3( $round ) );
$tpl->set( "open", $open );
$waitbet = $conf->get( "waitbet" );
$waitbet2 = $conf->get( "waitbet" );
$t2 = strtotime( $open." ".$waitbet );
$stopbet = $conf->get( "waitbet" );
$stopbet2 = $conf->get( "waitbet" );
$t1 = strtotime( $open." ".$stopbet );
$tpl->Set( "timestap", $t1 - systime( ) );
$tpl->set( "phptime", systime( ) );
include_once( "class_6h/class.menu.php" );
$fieldArr = array( "round" => $round, "open" => $open, "lotto_id" => $lotto_id, "split_id" => 1 );
$onlineMenu = new menu_6h( 1, $fieldArr );
$selectid = getvar( "select" ) == "" ? 0 : getvar( "select" );
$menuList = $onlineMenu->getMenu( $selectid );
$tpl->set( "menuList", $menuList );
unset( $onlineMenu );
$tpl->load( "main", "now3.htm" );
$tpl->set( "jslang", $g_conf['language'] );
$tpl->show( "main" );
$ui->footer();
?>